package com.mt.roll.core.dal.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 库位存储箱基板对应表
 * </p>
 *
 * @author mt
 * @since 2022-03-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_location_storage_sub")
public class LocationStorageSub extends Model<LocationStorageSub> {

    private static final long serialVersionUID = 1L;

      @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 删除标志，是否有效:1 可用 0不可用
     */
    @TableField("valid")
    @TableLogic
    private Integer valid;

    /**
     * 添加时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 创建人id
     */
    @TableField("creator_id")
    private Integer creatorId;

    /**
     * 更新人id
     */
    @TableField("updater_id")
    private Integer updaterId;

    /**
     * 修改时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 版本号 默认为 1
     */
    @TableField("version")
    @Version
    private String version;

    /**
     * 基板状态， 0代表 ok，1代表nok；；； dummy状态的基板也是可以被放到ok箱子的
     */
    @TableField("status")
    private Integer status;

    /**
     * 编码
     */
    @TableField("code")
    private String code;

    /**
     * 当前库存存储箱信息关联id
     */
    @TableField("location_storage_sub_id")
    private Long locationStorageSubId;

    /**
     * 库位id
     */
    @TableField("location_id")
    private Long locationId;

    /**
     * 库位名
     */
    @TableField("location_name")
    private String locationName;

    /**
     * 存储箱id
     */
    @TableField("storage_id")
    private Long storageId;

    /**
     * 存储箱号
     */
    @TableField("storage_box_fid")
    private String storageBoxFid;

    /**
     * 基板id
     */
    @TableField("sub_code")
    private String subCode;

    /**
     * 存储箱层
     */
    @TableField("storage_level")
    private Integer storageLevel;

    /**
     * 基板类型
     */
    @TableField("sub_type")
    private Integer subType;

    /**
     * 机械手抓取基板，上片或者下片时间，这个时间是从plc中获取
     */
    @TableField("operator_time")
    private String operatorTime;

    /**
     * 1 此基板被存入箱子；2 此基板从箱子被取出
     */
    @TableField("sub_storage_status")
    private Integer subStorageStatus;

    /**
     * 机械手id，此字段从plc中获取
     */
    @TableField("machine_hand_id")
    private String machineHandId;

    /**
     * 基板在存储箱中的位置，存储箱中从下往上数1-60，60片玻璃一次性取过来的 放在数组里 数组里的顺序就是基板位置顺序
     */
    @TableField("sub_position")
    private Integer subPosition;


    public static final String ID = "id";

    public static final String VALID = "valid";

    public static final String CREATE_TIME = "create_time";

    public static final String CREATOR_ID = "creator_id";

    public static final String UPDATER_ID = "updater_id";

    public static final String UPDATE_TIME = "update_time";

    public static final String VERSION = "version";

    public static final String STATUS = "status";

    public static final String CODE = "code";

    public static final String LOCATION_STORAGE_SUB_ID = "location_storage_sub_id";

    public static final String LOCATION_ID = "location_id";

    public static final String LOCATION_NAME = "location_name";

    public static final String STORAGE_ID = "storage_id";

    public static final String STORAGE_BOX_FID = "storage_box_fid";

    public static final String SUB_CODE = "sub_code";

    public static final String STORAGE_LEVEL = "storage_level";

    public static final String SUB_TYPE = "sub_type";

    public static final String OPERATOR_TIME = "operator_time";

    public static final String SUB_STORAGE_STATUS = "sub_storage_status";

    public static final String MACHINE_HAND_ID = "machine_hand_id";

    public static final String SUB_POSITION = "sub_position";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
